console.log(process.env.NODE_ENV)

export default {
  router: {
    linkActiveClass: 'active',
    watchQuery: ['page'],
    extendRoutes(routes, resolve) {
      routes.splice(0)
      const router = [{
        path: '/',
        name: 'index',
        component: resolve(__dirname, 'layout/index'),
        children: [{
          path: '',
          name: 'home',
          component: resolve(__dirname, 'pages/home')
        }, {
          path: '/login',
          name: 'login',
          component: resolve(__dirname, 'pages/login')
        }, {
          path: '/register',
          name: 'register',
          component: resolve(__dirname, 'pages/login')
        }, {
          path: '/profile/:username',
          name: 'profile',
          component: resolve(__dirname, 'pages/profile')
        }, {
          path: '/settings',
          name: 'settings',
          component: resolve(__dirname, 'pages/settings')
        }, {
          path: '/editor',
          name: 'editor',
          component: resolve(__dirname, 'pages/editor')
        }, {
          path: '/article/:slug',
          name: 'article',
          component: resolve(__dirname, 'pages/article')
        }]
      }]
      routes.push(...router)
    }
  },

  server: {
    host: process.env.NODE_ENV === 'production' ? '0.0.0.0' : 'localhost',
    port: 3000
  },

  plugins: [
    '~/plugins/request',
    '~/plugins/dateFormat'
  ]
}

